<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@include file="/includes.jsp"%>
<%@include file="/javascript/pickList.jsp"%>

<h1 class="layout">
    <logic:empty name="sprintValue" property="sprintId">
        Create
    </logic:empty>
    <logic:notEmpty name="sprintValue" property="sprintId">
        Edit
    </logic:notEmpty>
    Sprint
</h1>

<html:form action="sprint.do?method=edit" method="post">
    <table class="layout" style="background-image: url(<html:rewrite page='/icons/sprint-32x32.png'/>);">
        <tr>
            <th class="layout">Name:</th>
            <td class="layout"><html:text name="sprintActionForm" property="name" size="80"/></td>
        </tr>
        <tr>
            <th class="layout">Description:</th>
            <td class="layout"><html:textarea name="sprintActionForm" property="description" cols="60" rows="10"/></td>
        </tr>
        <tr>
            <th class="layout">StartDate:</th>
            <td class="layout">
                <html:select name="sprintActionForm" property="startYear" size="1">
                    <html:options collection="years" property="integer" labelProperty="string"/>
                </html:select>-<html:select name="sprintActionForm" property="startMonth" size="1">
                    <html:options collection="months" property="integer" labelProperty="string"/>
                </html:select>-<html:select name="sprintActionForm" property="startDay" size="1">
                    <html:options collection="days" property="integer" labelProperty="string"/>
                </html:select>
            </td>
        </tr>
        <tr>
            <th class="layout">Stop Date:</th>
            <td class="layout">
                <html:select name="sprintActionForm" property="stopYear" size="1">
                    <html:options collection="years" property="integer" labelProperty="string"/>
                </html:select>-<html:select name="sprintActionForm" property="stopMonth" size="1">
                    <html:options collection="months" property="integer" labelProperty="string"/>
                </html:select>-<html:select name="sprintActionForm" property="stopDay" size="1">
                    <html:options collection="days" property="integer" labelProperty="string"/>
                </html:select>
            </td>
        </tr>
        <tr>
            <th class="layout">Scrum Master:</th>
            <td class="layout">
                <html:select name="sprintActionForm" property="scrumMasterId">
                    <html:options collection="allPersonPairs" property="integer" labelProperty="string"/>
                </html:select>
            </td>
        </tr>
        <tr>
            <th class="layout">Team:</th>
            <td class="layout">
                <table>
                    <tr>
                        <td>
                            <html:select multiple="true" size="5" name="sprintActionForm" property="allTeamPersonIds" style="width:200">
                                <html:options collection="allPersonPairs" property="integer" labelProperty="string"/>
                            </html:select>
                        </td>
                        <td align="center" valign="middle">
                            <input type="button" onclick="remove(this.form.allTeamPersonIds,this.form.teamPersonIds)" value="<<" id=button1 name=button1>
                            <input type="button" onclick="add(this.form.allTeamPersonIds,this.form.teamPersonIds)" value=">>" id=button2 name=button2>
                        </td>
                        <td>
                            <html:select multiple="true" size="5" name="sprintActionForm" property="teamPersonIds" style="width:200">
                                <html:options collection="teamPersonPairs" property="integer" labelProperty="string"/>
                            </html:select>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div class="buttons">
        <html:submit property="btnSubmit" value="OK" onclick="selectAll(document.sprintValueActionForm.teamPersonIds);"/>
        <html:cancel property="btnSubmit" value="Cancel"/>
    </div>
</html:form>
